<?php
	include("includes/secure.php");
	if(isset($_GET['emde_code']) && (int)$_GET['emde_code']>0 && count($_GET)==1){
		session_start();
		$_SESSION['emde_code'] = $_GET['emde_code'];
		ob_start();
		include(dirname(__FILE__).'/pdf/billCompany.php');
		$content = ob_get_clean();
		
		// conversion HTML => PDF
		require_once('includes/html2pdf/html2pdf.class.php');
		$html2pdf = new HTML2PDF('P','A4','fr', false, 'ISO-8859-15');
		$html2pdf->pdf->SetDisplayMode('fullpage');
		$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
		$html2pdf->Output('asscCompany_'.$_GET['emde_code'].'.pdf');
	}else{
		echo "<script> window.location.href = 'logout.php' </script>";
	}
?>
